<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class EditAddWxinfoUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * 添加wx 用户的授权信息
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('open_id')->after('id');
            $table->string('avatar')->after('name');
            $table->dropColumn(['email_verified_at','remember_token']);
            $table->string('password')->nullable()->comment('用户密码')->change();
            $table->string('email')->nullable()->comment('邮箱')->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            //
        });
    }
}
